package com.fpx.open.platform.service;

import com.fpx.open.platform.domain.ae.AEOrder;
import com.fpx.open.platform.domain.ae.offline.OfflineRequest;
import com.fpx.open.platform.domain.exception.ServiceException;
import com.fpx.open.platform.domain.prealert.OrderAction;
import com.fpx.open.platform.domain.prealert.OrderHandover;
import com.fpx.open.platform.domain.prealert.OrderInfo;
import com.fpx.open.platform.domain.prealert.PrealertOrderAttachTR;
import com.fpx.xms.api.rabbitmq.message.AEOrderMessage;

public interface AEOrderService {
    public void saveOrder(AEOrder order) throws ServiceException;
    
    /**
     * 预处理订单
     * @param order 订单信息
     * @param orderMsg 存储于队列消息
     * @throws ServiceException
     */
    public void preHandleOrder(AEOrder order,AEOrderMessage orderMsg) throws ServiceException;
    
    /**
     * 预处理批次
     * @param order 订单信息
     * @param orderHandover 交接信息
     * @param orderMsg 存储于队列消息
     * @throws ServiceException
     */
    public void preHandleBatchOrder(OrderInfo orderInfo,OrderHandover orderHandover,AEOrderMessage orderMsg) throws ServiceException;
    
    /**
     * 保存订单数据
     * @param aeOrderMsg
     * @throws ServiceException
     */
    public void saveOrder(AEOrderMessage aeOrderMsg) throws ServiceException;
    
    /**
     * 保存B段订单预报信息
     * @param orderInfo
     * @param orderHandover
     * @throws ServiceException
     */
    public void saveOrder(OrderInfo orderInfo, OrderHandover orderHandover) throws ServiceException;
    
    public int cancleOrder(String orderNo,String companyId)throws ServiceException;
    
    /**
     * 关闭订单
     * @param orderNo  订单号 
     * @param companyId  cm_id
     * @return
     * @throws ServiceException
     */
    public int closeOrder(String orderNo, String companyId) throws ServiceException;
    
    public void saveOfflineOrder(OfflineRequest offlineRequest) throws ServiceException;
    
    public int whetherExistsOrder(String orderNo);
    
    void updateOrderAttach(PrealertOrderAttachTR orderAttach);
    
    void addOrderAction(OrderAction orderAction);
    
    void clearCache();
    
    public boolean hasConsume(String msgId) ;
    
    public void addAEOrderConsumeRecord(String msgId);
    
}
